//
//  AboutUsVC.m
//  ErWa
//
//  Created by 王阳阳 on 16/3/10.
//  Copyright © 2016年 www.lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "AboutUsVC.h"

@interface AboutUsVC ()<UIActionSheetDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate>
@property (nonatomic, retain) UILabel *contentLabel;

@end

@implementation AboutUsVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    //背景图片
//    UIImageView *backImg = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].bounds];
//    [self.view addSubview:backImg];
//    backImg.image = [UIImage imageNamed:@"registerBackground.jpg"];
//    backImg.userInteractionEnabled = YES;
    // 内容Label
    self.contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 20, self.view.frame.size.width - 40, self.view.frame.size.height - 40)];
    [self.view addSubview:_contentLabel];
    
    _contentLabel.numberOfLines = 0;
    _contentLabel.text = @"本软件是集装修设计及方案一体的平台,汇聚国内外众多的使用设计方案,让家装更加简单化,让设计更加贴近生活,深度定制您的家! 给你一个最温暖的专属小窝~";
    
    UIButton *shareButton = [UIButton buttonWithType:UIButtonTypeSystem];
    shareButton.frame = CGRectMake(0, 0, self.view.frame.size.width / 4, self.view.frame.size.height / 14);
    shareButton.center = CGPointMake(self.view.center.x, self.view.frame.size.height / 5 * 4);
    shareButton.backgroundColor = [UIColor cyanColor];
    shareButton.tintColor = [UIColor grayColor];
    shareButton.layer.cornerRadius = 5;
    shareButton.clipsToBounds = YES;
    [shareButton setTitle:@"分享给好友" forState:UIControlStateNormal];
    [shareButton addTarget:self action:@selector(shareAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:shareButton];
//    [backImg addSubview:shareButton];
}
- (void)shareAction
{
    // 下方弹出选择框
    UIActionSheet *shareSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"打电话给好友" otherButtonTitles:@"发信息给好友", nil];
    [shareSheet showInView:self.view];
}

- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if (buttonIndex == actionSheet.cancelButtonIndex) {
        return;
    }else if (buttonIndex == actionSheet.destructiveButtonIndex){
        ///打电话
        NSURL *url = [NSURL URLWithString:@"tel://13029813356"];
        [[UIApplication sharedApplication] openURL:url];
    }else {
        ///发信息
        NSURL *url = [NSURL URLWithString:@"sms://13029813356"];
        [[UIApplication sharedApplication] openURL:url];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
